//
//  LSRollingDetailCell.m
//  LookScore
//
//  Created by wws on 2018/5/4.
//  Copyright © 2018年 ChongQingXunTiCompany. All rights reserved.
//

#import "LSRollingDetailCell.h"
#import "LSRecommendDetailModel.h"
@implementation LSRollingDetailCell{
    
    UILabel * _contentLabel;
}
+ (LSRollingDetailCell *)rollingDetailCellByTableView:(UITableView *)tableView{
    LSRollingDetailCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(self)];
    if (!cell) {
        cell = [[LSRollingDetailCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self)];
    }
    
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addContentView];
    }
    return self;
}



- (void)addContentView{
    
    UILabel * label = [[UILabel alloc] init];
    label.text = @"推荐理由";
    label.font = LSFontSize13;
    label.textColor = LSTitleGrayColor2;
    [self.contentView addSubview:label];
    label.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .autoHeightRatio(0);
    [label setSingleLineAutoResizeWithMaxWidth:180];
    _contentLabel = [[UILabel alloc] init];
    _contentLabel.textColor = LSTitleGrayColor2;
    _contentLabel.font = LSFontSize12;
    [self.contentView addSubview:_contentLabel];
    _contentLabel.sd_layout
    .leftEqualToView(label)
    .topSpaceToView(label, 10)
    .rightSpaceToView(self.contentView, 10)
    .autoHeightRatio(0);
    
    [self setupAutoHeightWithBottomView:_contentLabel bottomMargin:5];
}
- (void)setModel:(LSRecommendDetailModel *)model{
    _model = model;
    _contentLabel.text = model.Reason;
    
}
@end
